package com.dhy.controller;

import com.dhy.msg.CommonResult;
import com.dhy.pojo.Payment;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController
{
    @Value("${server.port}")
    private String server_port;
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id)
    {
        if(id==1)
        {
            return new CommonResult(200,"恭喜您查询成功,当前端口号为:"+server_port);
        }else{
            return new CommonResult(444,"没有对应记录,查询ID: "+id,null);
        }
    }
    @GetMapping("/payment/lb/{id}")
    public CommonResult<Payment> getPayIb(@PathVariable("id")Integer id)
    {
        return new CommonResult<>(200,"(*^▽^*)"+"    当前端口号:"+server_port);
    }
}
